package com.itheima.controller;


import com.itheima.domain.Office;
import com.itheima.service.OfficeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/office")
public class OfficeController {

    @Autowired
    @Qualifier("officeService")
    private OfficeService officeService;


    //查询所有科室的方法
    @ResponseBody
    @RequestMapping("/work")
    public List<Office> findAll(){
        List<Office> all = officeService.findAll();
        return all;
    }


}
